package dict

import (
	"fmt"
	"tacitus/library"
	"tacitus/library/database"
	"xorm.io/xorm"
)

var x *xorm.Engine

func init() {
	x = db.Use("site")

	if lib.Config.Develop.Sync {
		if err := x.Sync2(new(Key), new(Item)); err != nil {
			panic(err)
		}
	}

	if err := Reload(); err != nil {
		fmt.Println("加载系统字典失败")
		panic(err)
	}
}

